package com.xiaozhichao.javaapi.designpattern.strategy;

import org.junit.Test;

/**
 * 策略 模式
 */
public class StrategyTest {

    @Test
    public void test(){
        String exp = "2-8";
        ICalculator cal = new Minus();
        int result = cal.calculate(exp);
        System.out.println(result);
    }

    @Test
    public void test1(){
        String exp = "0103";
        System.out.println(Integer.valueOf(exp) + 1);
        System.out.println(String.format("%04d",Integer.valueOf(exp)+1));
    }
}
